unit SpeedButtonA;

interface

uses
  Windows, Messages, SysUtils, Classes, Controls, Buttons, Menus;

type
  TSpeedButton = class(Buttons.TSpeedButton)
  public              
    procedure Click; override;
  end;

implementation



{ TMenuButton }

procedure TSpeedButton.Click;
var
    P: TPoint;
begin
    if PopupMenu <> nil then
    begin
        P.X := 0;
        P.Y := 0;
        P := ClientToScreen(P);
        if Align = alLeft then
        begin
	        PopUpMenu.Popup(P.X - 1, P.Y + Height);
        end
        else
        begin
	        PopUpMenu.Popup(P.X + Width, P.Y + Height);
        end;
    end;
    
    inherited;
end;

end.
